package com.ybkj.daijia.server.service.impl;

import com.ybkj.daijia.server.mapper.DriverLocationInfoMapper;
import com.ybkj.daijia.server.model.DriverLocationInfo;
import com.ybkj.daijia.server.service.DriverLocationInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 * @author Shine
 */
@Service
public class DefaultDriverLocationInfoService implements DriverLocationInfoService {

    private static final Logger logger = LoggerFactory
        .getLogger(DefaultDriverLocationInfoService.class);

    @Autowired
    private DriverLocationInfoMapper driverLocationInfoMapper;


    @Transactional(rollbackFor = Exception.class)
    public DriverLocationInfo insertRecord(DriverLocationInfo driverLocationInfo) {

        driverLocationInfoMapper.insertRecord(driverLocationInfo);

        return driverLocationInfo;

    }


    @Transactional(rollbackFor = Exception.class)
    public int updateByPrimaryKey(DriverLocationInfo driverLocationInfo) {

        return driverLocationInfoMapper.updateByPrimaryKey(driverLocationInfo);

    }

    @Override
    public DriverLocationInfo findOne(Long id) {
        DriverLocationInfo driverLocationInfo = driverLocationInfoMapper.selectByPrimaryKey(id);

        return driverLocationInfo;
    }

    @Override
    public DriverLocationInfo findByEmploy(Long employId) {

        return driverLocationInfoMapper.selectByEmploy(employId);
    }


}
